# Eclass for gentoo-erlay packages
#
# Copyright 2007, Christopher Covington <covracer@gmail.com>
#
# Licensed under the GNU General Public License, v2
#
# $Header: Exp $

# -----------------------------------------------------------------------------
# @eclass-begin
# @eclass-summary Eclass for gentoo-erlay Packages
#
# This eclass should be inherited by packages in the erlay overlay.
# -----------------------------------------------------------------------------

EXPORT_FUNCTIONS pkg_postinst edie

# ------------------------------------------------------------------------------
# @eclass_info
#
# Print out info regarding the unofficial status of erlay overlay packages and 
# where to send bugs, flames and contributions.
# ------------------------------------------------------------------------------
erlay-pkg_info() {
	ewarn "This package was installed from an unofficial Erlang overlay. It is"
	ewarn "not supported by the Gentoo developers. Please don't file bugs in"
	ewarn "Bugzilla or post in any official Gentoo forum besides the"
	ewarn "Unsupported Software forum."
	echo
	einfo "Please visit the project page [1] or the forum thread [2] to"
	einfo "report problems, discuss the project, learn more or contribute."
	einfo "1. http://code.google.com/p/gentoo-erlay/"
	einfo "2. http://forums.gentoo.org/viewtopic-t-537334.html"
}

# ------------------------------------------------------------------------------
# @eclass_edie
#
# Print out how to properly report bugs to the erlay project.
# ------------------------------------------------------------------------------
erlay-pkg_edie() {
	einfo "Please make sure you have synced recently ('layman -S') and file a"
	einfo "report at http://code.google.com/p/gentoo-erlay/issues/list if the"
	einfo "problem has not already been reported."
	echo
	ewarn "Please don't file bugs in Bugzilla or post in any official Gentoo"
	ewarn "forum besides the Unsupported Software forum."
	die ${1}
}

# ------------------------------------------------------------------------------
# @eclass-pkg_postinst
#
# Default pkg_postinst for erlay packages
# ------------------------------------------------------------------------------
erlay-pkg_pkg_postinst() {
	erlay-pkg_info
}